From 06d507703db1778c6ebae2120b3e6295e60bc7bd Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Wed, 10 Nov 2004 15:32:19 +0000 Subject: [PATCH] Only shorten the label if it actually overlaps the resize grip. 2004-11-10 Matthias Clasen * gtk/gtkstatusbar.c (gtk_statusbar_size_allocate): Only shorten the label if it actually overlaps the resize grip. --- ChangeLog | 3 +++ ChangeLog.pre-2-10 | 3 +++ ChangeLog.pre-2-6 | 3 +++ ChangeLog.pre-2-8 | 3 +++ gtk/gtkstatusbar.c | 15 +++++++++------ 5 files changed, 21 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 869257f36c..37313d3fbe 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2004-11-10 Matthias Clasen + * gtk/gtkstatusbar.c (gtk_statusbar_size_allocate): Only + shorten the label if it actually overlaps the resize grip. + * gdk/linux-fb/*: Fix many sparse warnings. (#157253, Kjartan Maraas. diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 869257f36c..37313d3fbe 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,5 +1,8 @@ 2004-11-10 Matthias Clasen + * gtk/gtkstatusbar.c (gtk_statusbar_size_allocate): Only + shorten the label if it actually overlaps the resize grip. + * gdk/linux-fb/*: Fix many sparse warnings. (#157253, Kjartan Maraas. diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 869257f36c..37313d3fbe 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,5 +1,8 @@ 2004-11-10 Matthias Clasen + * gtk/gtkstatusbar.c (gtk_statusbar_size_allocate): Only + shorten the label if it actually overlaps the resize grip. + * gdk/linux-fb/*: Fix many sparse warnings. (#157253, Kjartan Maraas. diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 869257f36c..37313d3fbe 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,5 +1,8 @@ 2004-11-10 Matthias Clasen + * gtk/gtkstatusbar.c (gtk_statusbar_size_allocate): Only + shorten the label if it actually overlaps the resize grip. + * gdk/linux-fb/*: Fix many sparse warnings. (#157253, Kjartan Maraas. diff --git a/gtk/gtkstatusbar.c b/gtk/gtkstatusbar.c index aa41ce2c9c..0844335f6c 100644 --- a/gtk/gtkstatusbar.c +++ b/gtk/gtkstatusbar.c @@ -776,7 +776,7 @@ gtk_statusbar_size_allocate (GtkWidget *widget, if (statusbar->has_resize_grip && statusbar->grip_window) { - GdkRectangle rect; + GdkRectangle rect, overlap; GtkAllocation allocation; get_grip_rect (statusbar, &rect); @@ -787,11 +787,14 @@ gtk_statusbar_size_allocate (GtkWidget *widget, rect.width, rect.height); allocation = statusbar->label->allocation; - allocation.width -= rect.width; - if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL) - allocation.x += rect.width; - - gtk_widget_size_allocate (statusbar->label, &allocation); + if (gdk_rectangle_intersect (&rect, &allocation, &overlap)) + { + allocation.width -= rect.width; + if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL) + allocation.x += rect.width; + + gtk_widget_size_allocate (statusbar->label, &allocation); + } } } -- 2.30.2